package com.kuzufang.utils;

import com.alibaba.fastjson.JSON;

import java.util.List;

/**
 * Created by songyuanjin on 2017/9/29.
 */

public class JsonUtil {

    public static <T> T convert2Bean(Class<T> clazz, String jsonString) {
        T json = JSON.parseObject(jsonString, clazz);
        return json;
    }

    public static <T> List<T> convert2Array(String jsonString, Class<T> clazz) {
        List json = JSON.parseArray(jsonString, clazz);
        return json;
    }

}
